home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-16 | 7.9 KB | 229 lines | [TEXT/CCL2] |
-
- (in-package :TRAPS) ;
- ;
- ; Created: Friday, September 27, 1991 10:04:39 AM
- ; ImageCodec.p
- ; Pascal Interface to the Macintosh Libraries
- ;
- ;
- ; Copyright Apple Computer, Inc. 1991
- ; All rights reserved
- ;
- ;
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes := 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingImageCodec
- ; $SETC UsingImageCodec := 1
-
- ; $I+
- ; $SETC ImageCodecIncludes := UsingIncludes
- ; $SETC UsingIncludes := 1
- ; $IFC UNDEFINED UsingQuickDraw
-
- (require-interface 'QUICKDRAW) ; $I $$Shell(PInterfaces)QuickDraw.p
- ; $ENDC
- ; $IFC UNDEFINED UsingQDOffscreen
-
- (require-interface 'QDOFFSCREEN); $I $$Shell(PInterfaces)QDOffscreen.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingTypes
-
- (require-interface 'TYPES) ; $I $$Shell(PInterfaces)Types.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingComponents
-
- (require-interface 'COMPONENTS) ; $I $$Shell(PInterfaces)Components.p
- ; $ENDC
-
- ; $IFC UNDEFINED UsingImageCompression
-
- (require-interface 'IMAGECOMPRESSION); $I $$Shell(PInterfaces)ImageCompression.p
- ; $ENDC
-
- ; $SETC UsingIncludes := ImageCodecIncludes
-
- ; codec component selectors
- ; codec selectors 0-127 are reserved by Apple
- ; codec selectors 128-191 are subtype specific
- ; codec selectors 192-255 are vendor specific
- ; codec selectors 256-32767 are reserved by Apple
- ; negative selectors are reserved by the Component Manager
-
- (defconstant $codecGetCodecInfo #X0)
- (defconstant $codecGetCompressionTime #X1)
- (defconstant $codecGetMaxCompressionSize #X2)
- (defconstant $codecPreCompress #X3)
- (defconstant $codecBandCompress #X4)
- (defconstant $codecPreDecompress #X5)
- (defconstant $codecBandDecompress #X6)
- (defconstant $codecCDSequenceBusy #X7)
- (defconstant $codecGetCompressedImageSize #X8)
- (defconstant $codecGetSimilarity #X9)
- (defconstant $codecTrimImage #XA)
-
- ; codec capabilities flags
-
- (defconstant $codecCanScale #X1)
- (defconstant $codecCanMask #X2)
- (defconstant $codecCanMatte #X4)
- (defconstant $codecCanTransform #X8)
- (defconstant $codecCanTransferMode #X10)
- (defconstant $codecCanCopyPrev #X20)
- (defconstant $codecCanSpool #X40)
- (defconstant $codecCanClipVertical #X80)
- (defconstant $codecCanClipRectangular #X100)
- (defconstant $codecCanRemapColor #X200)
- (defconstant $codecCanFastDither #X400)
- (defconstant $codecCanSrcExtract #X800)
- (defconstant $codecCanCopyPrevComp #X1000)
- (defconstant $codecCanAsync #X2000)
- (defconstant $codecCanMakeMask #X4000)
- (defconstant $codecCanShift #X8000)
-
- (defconstant $codecConditionFirstBand #X1)
- (defconstant $codecConditionLastBand #X2)
- (defconstant $codecConditionCodecChangedMask #X80000000)
-
- (defconstant $codecInfoResourceType :|cdci|); codec info resource type
-
- (defrecord CodecCapabilities
- (flags :SIGNED-LONG)
- (wantedPixelSize :SIGNED-INTEGER)
- (extendWidth :SIGNED-INTEGER)
- (extendHeight :SIGNED-INTEGER)
- (bandMin :SIGNED-INTEGER)
- (bandInc :SIGNED-INTEGER)
- (pad :SIGNED-INTEGER)
- (time :SIGNED-INTEGER)
- )
- (def-mactype :CODECCAPABILITIESPTR (find-mactype :POINTER))
-
- (defrecord CodecCompressParams
- (sequenceID :SIGNED-LONG) ; precompress,bandcompress
- (imageDescription (:HANDLE :IMAGEDESCRIPTION)); precompress,bandcompress
- (data :POINTER)
- (bufferSize :SIGNED-LONG)
- (frameNumber :SIGNED-LONG)
- (startLine :SIGNED-LONG)
- (stopLine :SIGNED-LONG)
- (conditionFlags :SIGNED-LONG)
- (callerFlags :SIGNED-INTEGER)
- (capabilities (:POINTER :CODECCAPABILITIES)); precompress,bandcompress
- (ProgressProcRecord :PROGRESSPROCRECORD)
- (CompletionProcRecord :COMPLETIONPROCRECORD)
- (FlushProcRecord :FLUSHPROCRECORD)
- (srcPixMap :PIXMAP) ; precompress,bandcompress
- (prevPixMap :PIXMAP)
- (spatialQuality :SIGNED-LONG)
- (temporalQuality :SIGNED-LONG)
- (similarity :SIGNED-LONG)
- (reserved (:ARRAY :SIGNED-LONG 2))
- )
- (def-mactype :CODECCOMPRESSPARAMSPTR (find-mactype :POINTER))
-
- (defrecord CodecDecompressParams
- (sequenceID :SIGNED-LONG) ; predecompress,banddecompress
- (imageDescription (:HANDLE :IMAGEDESCRIPTION)); predecompress,banddecompress
- (data :POINTER)
- (bufferSize :SIGNED-LONG)
- (frameNumber :SIGNED-LONG)
- (startLine :SIGNED-LONG)
- (stopLine :SIGNED-LONG)
- (conditionFlags :SIGNED-LONG)
- (callerFlags :SIGNED-INTEGER)
- (capabilities (:POINTER :CODECCAPABILITIES)); predecompress,banddecompress
- (ProgressProcRecord :PROGRESSPROCRECORD)
- (CompletionProcRecord :COMPLETIONPROCRECORD)
- (DataProcRecord :DATAPROCRECORD)
- (port (:POINTER :CGRAFPORT)) ; predecompress,banddecompress
- (dstPixMap :PIXMAP) ; predecompress,banddecompress
- (maskBits (:POINTER :BITMAP))
- (mattePixMap (:POINTER :PIXMAP))
- (srcRect :RECT) ; predecompress,banddecompress
- (matrix (:POINTER :MATRIXRECORD)); predecompress,banddecompress
- (accuracy :SIGNED-LONG) ; predecompress,banddecompress
- (transferMode :SIGNED-INTEGER); predecompress,banddecompress
- (reserved (:ARRAY :SIGNED-LONG 2))
- )
- (def-mactype :CODECDECOMPRESSPARAMSPTR (find-mactype :POINTER))
-
-
- #| Not in ROM
- (deftrap _CDGETCODECINFO ((STORAGE :HANDLE) (INFO (:POINTER :CODECINFO)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDGETCOMPRESSIONTIME ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (SPATIALQUALITY (:POINTER :SIGNED-LONG)) (TEMPORALQUALITY (:POINTER :SIGNED-LONG)) (TIME (:POINTER :SIGNED-LONG)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDGETMAXCOMPRESSIONSIZE ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (QUALITY :SIGNED-LONG) (SIZE (:POINTER :SIGNED-LONG)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDPRECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDBANDCOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDPREDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDBANDDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDCODECBUSY ((STORAGE :HANDLE) (SEQ :SIGNED-LONG))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDGETCOMPRESSEDIMAGESIZE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (BUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (DATASIZE (:POINTER :SIGNED-LONG)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDGETSIMILARITY ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (SIMILARITY (:POINTER :SIGNED-LONG)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- #| Not in ROM
- (deftrap _CDTRIMIMAGE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (INDATA :POINTER) (INBUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (OUTDATA :POINTER) (OUTBUFFERSIZE :SIGNED-LONG) (FLUSHPROC (:POINTER :FLUSHPROCRECORD)) (TRIMRECT (:POINTER :RECT)) (PROGRESSPROC (:POINTER :PROGRESSPROCRECORD)))
- (:STACK :SIGNED-LONG)
- (:STACK-TRAP #x0))
- |#
- ; $ENDC
-
-
- (export '($CODECINFORESOURCETYPE $CODECCONDITIONCODECCHANGEDMASK
- $CODECCONDITIONLASTBAND $CODECCONDITIONFIRSTBAND $CODECCANSHIFT
- $CODECCANMAKEMASK $CODECCANASYNC $CODECCANCOPYPREVCOMP
- $CODECCANSRCEXTRACT $CODECCANFASTDITHER $CODECCANREMAPCOLOR
- $CODECCANCLIPRECTANGULAR $CODECCANCLIPVERTICAL $CODECCANSPOOL
- $CODECCANCOPYPREV $CODECCANTRANSFERMODE $CODECCANTRANSFORM
- $CODECCANMATTE $CODECCANMASK $CODECCANSCALE $CODECTRIMIMAGE
- $CODECGETSIMILARITY $CODECGETCOMPRESSEDIMAGESIZE $CODECCDSEQUENCEBUSY
- $CODECBANDDECOMPRESS $CODECPREDECOMPRESS $CODECBANDCOMPRESS
- $CODECPRECOMPRESS $CODECGETMAXCOMPRESSIONSIZE
- $CODECGETCOMPRESSIONTIME $CODECGETCODECINFO))
- (provide-interface 'ImageCodec)